import service from '@/utils/request'
import qs from 'qs'
// eslint-disable-next-line no-unused-vars
const { httpPostForm, httpPost, httpGet } = service

const request = {
    //=============================设备租赁收入查询===========================
    //设备租赁基本信息查询
    findByIdBasic (id) {
        return httpGet({
            url: '/subcontract/facilityLeaseOut/findFacilityLeaseOutById',
            params: {
                billId: id,
            },
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    //设备租赁变更基本信息查询
    findByIdChangeBasic (id) {
        return httpGet({
            url: '/subcontract/facilityAdj/findFacilityLeaseOutAdjById',
            params: {
                billId: id,
            },
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    //=============================设备销售查询===========================
    //设备销售基本信息查询
    findFacilitySaleById (id) {
        return httpGet({
            url: '/subcontract/facilitySale/findFacilitySaleById',
            params: {
                billId: id,
            },
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    //设备销售变更基本信息查询
    findFacilitySaleAdjById (id) {
        return httpGet({
            url: '/subcontract/facilityAdj/findFacilitySaleAdjById',
            params: {
                billId: id,
            },
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    //=============================设备废旧处置查询===========================
    //设备废旧处置基本信息查询
    findFacilityWasteDisposalById (id) {
        return httpGet({
            url: '/subcontract/facilityWasteDisposal/findFacilityWasteDisposalById',
            params: {
                billId: id,
            },
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    //设备废旧处置变更基本信息查询
    findFacilityWasteDisposalAdjById (id) {
        return httpGet({
            url: '/subcontract/facilityAdj/findFacilityWasteDisposalAdjById',
            params: {
                billId: id,
            },
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    //=============================设备收入类创建变更===========================
    //变更创建
    createFacilityIncomeAdj (id) {
        return httpPostForm({
            url: '/subcontract/facilityAdj/createFacilityIncomeAdj',
            params: {
                billId: id,
            },
        })
    },
    //=============================设备收入类查询===========================
    //变更历史查询
    findByIdchangeHistory (id) {
        return httpGet({
            url: '/subcontract/facilityAdj/listAllFacilityIncomeAdj',
            params: {
                billId: id,
            },
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    //======================================设备收入类提交===========================
    //设备提交
    findByIdsubmit (id) {
        return httpPostForm({
            url: '/subcontract/facilityIncome/submitFacilityIncome',
            params: {
                billId: id,
            },
        })
    },
    //设备变更提交
    findByIdChangesubmit (id) {
        return httpPostForm({
            url: '/subcontract/facilityAdj/submitFacilityIncomeAdj',
            params: {
                billId: id,
            },
        })
    },
    //======================================设备收入类保存===========================
    //签订保存
    saveFacilityIncome (params) {
        return httpPost({
            url: '/subcontract/facilityIncome/saveFacilityIncome',
            params,
        })
    },
    //变更保存
    saveFacilityIncomeAdj (params) {
        return httpPost({
            url: '/subcontract/facilityAdj/saveFacilityIncomeAdj',
            params,
        })
    },
    //======================================设备收入类删除===========================
    //逻辑删除
    findByIdDelete (id) {
        const params = qs.stringify({
            billId: id,
        })
        return httpPost({
            url: '/subcontract/facilityIncome/deleteFacilityIncome',
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            },
            params,
        })
    },
    //变更逻辑删除
    findByIdChangeDelete (id) {
        const params = qs.stringify({
            billId: id,
        })
        return httpPost({
            url: '/subcontract/facilityAdj/deleteFacilityIncomeAdj',
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            },
            params,
        })
    },
}
export default request